extends "res://tscn/book/tab.gd"


# Declare member variables here. Examples:
# var a = 2
# var b = "text"

func initOptBtns():
	opt1.setTagName('Mod')
	opt1.setItems(tag1List)
	chaNum.hide()

# Called when the node enters the scene tree for the first time.
func reInit():
	var faciBtns = box.get_children()
	for btn in faciBtns:
		if not btn.faci : continue 
		var canShow = true 
		
		if selectTag1 and selectTag1 != utils.getModNameFromData(btn.faci):
			canShow = false
				
		if findName != null and canShow:
			for text in findName.split(" "):
				if text and text.length() > 0 and text.find(" ") < 0:
					var regex = RegEx.new()
					regex.compile(".*" + text +".*")
					var result = regex.search(btn.faci.name)
					canShow = canShow and is_instance_valid(result)
		btn.set_visible(canShow)

# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass
